#ifndef _UI_MULTI_LINE_H_
#define _UI_MULTI_LINE_H_

#include <vector>
#include "font/font.h"
#include "ui_widget.h"
namespace ui
{
class UIMultiLine : public UIWidget
{
public:
/// stuff that every self-respecting widget should have
						UIMultiLine(UIWidget* pParent,const std::string& Name = "");
	virtual				~UIMultiLine();
	virtual bool		Create(const std::string& Name, const math::Vec2& Pos = math::Vec2(0.5f, 0.5f), const math::Vec2& Size= math::Vec2(0.1f, 0.1f));
	virtual	bool		Load(LuaPlus::LuaObject& _LObj);
	/// update
	virtual	bool		Tick(float dt);
	/// display
	virtual bool		Render(bool Force = false);
	/// register with LUA Bind
	static	void		Register(LuaPlus::LuaState* _pScript);

	virtual void		SetTextA(const std::string& Text);
	virtual void		SetTextW(const std::wstring& Text);

	
	//// specifics for multiline	
	void				ScrollUp();
	void				ScrollDown();
	void				Clear();
	virtual UIWidget*	GetClone();

	virtual void		RefreshText();

protected:
	virtual bool		ExportSpecificsToFile(script::WriteLua*	pWL);

	Font::GlyphData*	m_GlyphA[Font::MAX_CHAR];
	Font::LineData		m_LineA[Font::MAX_LINES];

	int					m_LineC;
	int					m_GlyphC;

	unsigned int			m_Offset;
	math::Vec2				m_TextSize;
	std::wstring		m_BaseString;

};


}  //namespace ui

#endif // _UI_MULTI_LINE_H_